package com.ingesup.services;

import java.util.List;

import org.springframework.flex.remoting.RemotingDestination;
import org.springframework.stereotype.Service;

import com.ingesup.dao.LettreDao;
import com.ingesup.dao.LettreDaoImpl;
import com.ingesup.entities.LettreType;

/**
 * @author FDEJEAN
 */

@Service
@RemotingDestination("lettreService")
public class LettreServiceImpl implements LettreService {

	private static LettreDao dao;
	
	static {
		dao = new LettreDaoImpl(LettreType.class);
	}
	
	/**
	 * {@inheritDoc}
	 */
	public LettreType createLettreType(LettreType toCreate) {
		return dao.create(toCreate);
	}

	/**
	 * {@inheritDoc}
	 */
	public void updateLettreType(LettreType toUpdate) {
		dao.update(toUpdate);
	}

	/**
	 * {@inheritDoc}
	 */
	public void deleteLettreType(LettreType toDelete) {
		dao.delete(toDelete);
	}

	/**
	 * {@inheritDoc}
	 */
	public LettreType getLettreType(long id) {
		return dao.read(id);
	}

	/**
	 * {@inheritDoc}
	 */
	public List<LettreType> getListLettre() {
		return dao.getAll();
	}
}
